#ifndef __OLED_H
#define __OLED_H 

#include "stdlib.h"	

#define u8 unsigned char
#define u16 unsigned short
#define u32 unsigned long

#define SDA "/sys/class/leds/led_blue/brightness"
#define SCK "/sys/class/leds/led_yellow/brightness"
#define SDA_SET "/sys/class/leds/led_blue/trigger"
#define SCK_SET "/sys/class/leds/led_yellow/trigger"

#define OLED_SCL_Clr() gpio_write_pin(SCK,0)//SCL
#define OLED_SCL_Set() gpio_write_pin(SCK,1)

#define OLED_SDA_Clr() gpio_write_pin(SDA,0)//DIN
#define OLED_SDA_Set() gpio_write_pin(SDA,1)

#define OLED_CMD  0
#define OLED_DATA 1

void OLED_ClearPoint(u8 x,u8 y);
void OLED_ColorTurn(u8 i);
void OLED_DisplayTurn(u8 i);
void I2C_Start(void);
void I2C_Stop(void);
void I2C_WaitAck(void);
void Send_Byte(u8 dat);
void OLED_WR_Byte(u8 dat,u8 mode);
void OLED_DisPlay_On(void);
void OLED_DisPlay_Off(void);
void OLED_Refresh(void);
void OLED_Clear(void);
void OLED_DrawPoint(u8 x,u8 y,u8 t);
void OLED_DrawLine(u8 x1,u8 y1,u8 x2,u8 y2,u8 mode);
void OLED_DrawCircle(u8 x,u8 y,u8 r);
void OLED_ShowChar(u8 x,u8 y,u8 chr,u8 size1,u8 mode);
void OLED_ShowChar6x8(u8 x,u8 y,u8 chr,u8 mode);
void OLED_ShowString(u8 x,u8 y,u8 *chr,u8 size1,u8 mode);
void OLED_ShowNum(u8 x,u8 y,u32 num,u8 len,u8 size1,u8 mode);
void OLED_ShowChinese(u8 x,u8 y,u8 num,u8 size1,u8 mode);
void OLED_ScrollDisplay(u8 num,u8 space,u8 mode);
void OLED_ShowPicture(u8 x,u8 y,u8 sizex,u8 sizey,u8 BMP[],u8 mode);
void OLED_Init(void);

void gpio_write_pin(char *pin,int value);
int gpio_init();
#endif

